<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.4.0">


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">



<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.15.3/css/all.min.css" integrity="sha256-2H3fkXt6FEmrReK448mDVGKb3WW2ZZw35gI7vqHOE4Y=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/animate.css@3.1.1/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">

<script class="next-config" data-name="main" type="application/json">{"hostname":"example.com","root":"/","images":"/images","scheme":"Pisces","version":"8.7.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":false,"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"i18n":{"placeholder":"Searching...","empty":"We didn't find any results for the search: ${query}","hits_time":"${hits} results found in ${time} ms","hits":"${hits} results found"}}</script><script src="/js/config.js"></script>
<meta name="description" content="浏览器构造浏览器的进程多进程 发挥浏览器的性能，单进程那不就一次只能执行一个任务吗 一个页面就是一个进程，那单进程，不就一次只能开一个页面吗 并且相互独立，比如我一个页面崩溃了，另一个页面应该是不受影响的，因为进程之间是相互独立的  分类 渲染进程  目的  渲染htmlcss到页面中，这里为什么要用到这个js   包含多个线程  渲染线程  dom树  css树  布局树  计算其元素布局的位置">
<meta property="og:type" content="article">
<meta property="og:title" content="浏览器">
<meta property="og:url" content="http://example.com/2021/03/12/%E6%B5%8F%E8%A7%88%E5%99%A8%E6%9E%84%E9%80%A0/index.html">
<meta property="og:site_name" content="Hexo">
<meta property="og:description" content="浏览器构造浏览器的进程多进程 发挥浏览器的性能，单进程那不就一次只能执行一个任务吗 一个页面就是一个进程，那单进程，不就一次只能开一个页面吗 并且相互独立，比如我一个页面崩溃了，另一个页面应该是不受影响的，因为进程之间是相互独立的  分类 渲染进程  目的  渲染htmlcss到页面中，这里为什么要用到这个js   包含多个线程  渲染线程  dom树  css树  布局树  计算其元素布局的位置">
<meta property="og:locale" content="en_US">
<meta property="article:published_time" content="2021-03-12T14:20:47.000Z">
<meta property="article:modified_time" content="2021-08-26T04:06:04.866Z">
<meta property="article:author" content="John Doe">
<meta name="twitter:card" content="summary">


<link rel="canonical" href="http://example.com/2021/03/12/%E6%B5%8F%E8%A7%88%E5%99%A8%E6%9E%84%E9%80%A0/">



<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":false,"isPost":true,"lang":"en","comments":true,"permalink":"http://example.com/2021/03/12/%E6%B5%8F%E8%A7%88%E5%99%A8%E6%9E%84%E9%80%A0/","path":"2021/03/12/浏览器构造/","title":"浏览器"}</script>

<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>浏览器 | Hexo</title>
  




  <noscript>
    <link rel="stylesheet" href="/css/noscript.css">
  </noscript>
</head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="Toggle navigation bar" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <h1 class="site-title">Hexo</h1>
      <i class="logo-line"></i>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu">
        <li class="menu-item menu-item-首页"><a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a></li>
        <li class="menu-item menu-item-分类"><a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a></li>
        <li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>Archives</a></li>
  </ul>
</nav>




</div>
        
  
  <div class="toggle sidebar-toggle" role="button">
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
  </div>

  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          Table of Contents
        </li>
        <li class="sidebar-nav-overview">
          Overview
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#%E6%B5%8F%E8%A7%88%E5%99%A8%E6%9E%84%E9%80%A0"><span class="nav-number">1.</span> <span class="nav-text">浏览器构造</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E6%B5%8F%E8%A7%88%E5%99%A8%E7%9A%84%E8%BF%9B%E7%A8%8B"><span class="nav-number">1.1.</span> <span class="nav-text">浏览器的进程</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%A4%9A%E8%BF%9B%E7%A8%8B"><span class="nav-number">1.1.1.</span> <span class="nav-text">多进程</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%88%86%E7%B1%BB"><span class="nav-number">1.1.2.</span> <span class="nav-text">分类</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E9%87%8D%E7%BB%98%E9%87%8D%E6%8E%92"><span class="nav-number">1.1.3.</span> <span class="nav-text">重绘重排</span></a></li></ol></li></ol></li></ol></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-overview">
            <div class="site-author site-overview-item animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">John Doe</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap site-overview-item animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
        <a href="/archives/">
          <span class="site-state-item-count">20</span>
          <span class="site-state-item-name">posts</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
          <a href="/categories/">
        <span class="site-state-item-count">12</span>
        <span class="site-state-item-name">categories</span></a>
      </div>
  </nav>
</div>



          </div>
        </div>
      </div>
    </div>
  </aside>
  <div class="sidebar-dimmer"></div>


    </header>

    
  <div class="back-to-top" role="button" aria-label="Back to top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


    <div class="main-inner post posts-expand">


  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="en">
    <link itemprop="mainEntityOfPage" href="http://example.com/2021/03/12/%E6%B5%8F%E8%A7%88%E5%99%A8%E6%9E%84%E9%80%A0/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="John Doe">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Hexo">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          浏览器
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">Posted on</span>

      <time title="Created: 2021-03-12 22:20:47" itemprop="dateCreated datePublished" datetime="2021-03-12T22:20:47+08:00">2021-03-12</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">In</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E6%B5%8F%E8%A7%88%E5%99%A8/" itemprop="url" rel="index"><span itemprop="name">浏览器</span></a>
        </span>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
        <h1 id="浏览器构造"><a href="#浏览器构造" class="headerlink" title="浏览器构造"></a>浏览器构造</h1><h2 id="浏览器的进程"><a href="#浏览器的进程" class="headerlink" title="浏览器的进程"></a>浏览器的进程</h2><h3 id="多进程"><a href="#多进程" class="headerlink" title="多进程"></a>多进程</h3><ul>
<li>发挥浏览器的性能，单进程那不就一次只能执行一个任务吗</li>
<li>一个页面就是一个进程，那单进程，不就一次只能开一个页面吗</li>
<li>并且相互独立，比如我一个页面崩溃了，另一个页面应该是不受影响的，因为进程之间是相互独立的</li>
</ul>
<h3 id="分类"><a href="#分类" class="headerlink" title="分类"></a>分类</h3><ul>
<li><p>渲染进程</p>
<ul>
<li><p>目的</p>
<ul>
<li>渲染htmlcss到页面中，这里为什么要用到这个js</li>
</ul>
</li>
<li><p>包含多个线程</p>
<ul>
<li><p>渲染线程</p>
<ul>
<li><p>dom树</p>
</li>
<li><p>css树</p>
</li>
<li><p>布局树</p>
<ul>
<li>计算其元素布局的位置</li>
</ul>
</li>
<li><p>分层</p>
<ul>
<li><p>为什么</p>
<ul>
<li>将页面拆分多个图层，那其中一个图层发生变动重新进行渲染，其它的图层不会发生变动避免无效渲染</li>
</ul>
</li>
</ul>
</li>
<li><p>光珊化</p>
<ul>
<li>故名思意，将图层转化为图块—再转化为位图（栅格图像）划为多个格子，我只渲染可视区域的并转化为实际像素</li>
</ul>
</li>
<li><p>合成</p>
<ul>
<li>及浏览器将各层信息发送到GPU：进行合成显示到屏幕上</li>
</ul>
</li>
<li><p>transform</p>
<ul>
<li>调用gpu渲染，提升图层</li>
<li>调用了GPU进程进行渲染，而不去调用渲染进程：从而提升了渲染的效率</li>
</ul>
</li>
</ul>
</li>
<li><p>js执行线程</p>
</li>
<li><p>定时器触发线程</p>
<ul>
<li>如果放在js执行线程上，如果它阻塞了，影响定时器的准确度</li>
</ul>
</li>
<li><p>事件触发线程</p>
</li>
<li><p>http异步请求线程</p>
</li>
</ul>
</li>
</ul>
</li>
<li><p>浏览器进程</p>
</li>
<li><p>渲染进程</p>
</li>
<li><p>GPU进程</p>
</li>
<li><p>网络进程</p>
</li>
<li><p>插件进程</p>
</li>
</ul>
<h3 id="重绘重排"><a href="#重绘重排" class="headerlink" title="重绘重排"></a>重绘重排</h3><ul>
<li><p>重绘</p>
<ul>
<li><p>颜色的变动</p>
<ul>
<li>跳过布局树，分层阶段因此渲染消耗小</li>
</ul>
</li>
<li><p>怎么避免</p>
</li>
</ul>
</li>
<li><p>重排</p>
<ul>
<li><p>改变了位置与大小</p>
<ul>
<li>宽高位置变动</li>
<li>dom增加与删除相当于改变了大小</li>
<li>内外边距的改变，可以理解为位置的变动</li>
</ul>
</li>
<li><p>怎么避免</p>
</li>
</ul>
</li>
</ul>
<p><em>XMind - Evaluation Version</em></p>

    </div>

    
    
    

    <footer class="post-footer">

        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/2021/03/01/Vue%E5%8E%9F%E7%90%86/" rel="prev" title="Vue原理">
                  <i class="fa fa-chevron-left"></i> Vue原理
                </a>
            </div>
            <div class="post-nav-item">
                <a href="/2021/03/20/JS%E6%A0%B8%E5%BF%83%E9%AA%A8%E6%9E%B6/" rel="next" title="JS骨架梳理">
                  JS骨架梳理 <i class="fa fa-chevron-right"></i>
                </a>
            </div>
          </div>
    </footer>
  </article>
</div>






</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">


<div class="copyright">
  &copy; 
  <span itemprop="copyrightYear">2021</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">John Doe</span>
</div>
  <div class="powered-by">Powered by <a href="https://hexo.io/" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.js.org/pisces/" rel="noopener" target="_blank">NexT.Pisces</a>
  </div>

    </div>
  </footer>

  
  <script src="https://cdn.jsdelivr.net/npm/animejs@3.2.1/lib/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous"></script>
<script src="/js/comments.js"></script><script src="/js/utils.js"></script><script src="/js/motion.js"></script><script src="/js/next-boot.js"></script>

  




  





</body>
</html>
